﻿using System;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Garlic.CC.BaseClass;
using Garlic.CC.Utility;
using Garlic.BLL.Common;
using Garlic.DM.DataModel;
using Garlic.CC.WebUtility;
using Garlic.BLL;
using System.Collections.Generic;

public partial class SystemManagement_OperationLogDXYil : BasePage
{
    

    #region Page load
    /// <summary>
    /// 页面加载
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                this.MainFormView.DefaultMode = FormViewMode.ReadOnly;
                PageInit();               
            }
        }
        catch (Exception ex)
        {
            this.HandleException(ex);
        }
    }

    /// <summary>
    /// PageInit
    /// </summary>
    /// <param name="msg"></param>
    private void PageInit()
    {
        string operation_log_sn = "";
        operation_log_sn = this.Request.QueryString["operation_log_sn"];
        if (string.IsNullOrEmpty(operation_log_sn))
        {
            this.ShowMessage("页面需要操作序号参数！");
        }

        //数据初始化
        DataInit(operation_log_sn);

    }


    /// <summary>
    /// DataInit
    /// </summary>
    /// <param name="msg"></param>
    private void DataInit(string operation_log_sn)
    {
        this.formViewObjectDataSource.SelectParameters["operation_log_sn"].DefaultValue = "operation_log_sn = '" + operation_log_sn + "'";
    }
    #endregion        

    #region tool method
    /// <summary>
    /// show message 
    /// </summary>
    /// <param name="msg"></param>
    private void ShowMessage(string msg)
    {
        this.Message = msg;
    }

    protected void MainFormView_DataBound(object sender, EventArgs e)
    {

        try
        {
            //翻译最后运行状态
            List<CodeDetailInfo> CodeDetailActionInfo = CodeDetailManager.GetList("code_name = 'action_info'", "");
            if (CodeDetailActionInfo != null)
            {
                for (int i = 0; i < CodeDetailActionInfo.Count; i++)
                {
                    if (CodeDetailActionInfo[i].Code_value == ((Label)this.MainFormView.FindControl("lbAction_id")).Text)
                    {
                        ((Label)this.MainFormView.FindControl("lbAction_id")).Text = string.Format(CodeDetailActionInfo[i].Value_cdescription);
                        break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            this.HandleException(ex);
        }
    }
    #endregion    
}


